{% extends 'base.html' %}

{% block title %}{{ title }} - Will's Blog{% endblock %}

{% block content %}
<div class="row">
    <div class="col-md-3">
        {% include 'admin/sidebar.html' %}
    </div>
    
    <div class="col-md-9">
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h1>{{ title }}</h1>
            <a href="{{ url_for('admin.tags') }}" class="btn btn-secondary">
                <i class="bi bi-arrow-left"></i> 返回标签列表
            </a>
        </div>
        
        <div class="card">
            <div class="card-body">
                <form method="post">
                    {{ form.hidden_tag() }}
                    
                    <div class="mb-3">
                        {{ form.name.label(class="form-label") }}
                        {{ form.name(class="form-control") }}
                        {% if form.name.errors %}
                            <div class="invalid-feedback d-block">
                                {% for error in form.name.errors %}
                                    {{ error }}
                                {% endfor %}
                            </div>
                        {% endif %}
                    </div>
                    
                    <div class="d-grid gap-2">
                        <button type="submit" class="btn btn-primary">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
{% endblock %}